PATH
WebObjects 4.5 Documentation >
Getting Started With Direct to Java Client
Freezing Nib Files
Freezing nib files provides even more control over an application's user interface than freezing XML does. Using this technique, you create your own nib files in Interface Builder and instruct Direct to Java Client to use your nibs to create the user interface instead of dynamically generating it.
To create the nib, use Project Builder's "New in Project" command to add a new nib file to the ClientSideJava subproject. In the WebObjects Java Client Interface Wizard, choose EOF Application Skeleton. In your new nib, set the file's owner class to the name of the controller class that loads the nib. Also, be sure that the nib file's editing context and display group are connected.
EOEntityController introduces the ability to create a user interface from a nib file, so you can use frozen nib files only with EOEntityController subclasses (typically EOFormController, EOListController, EOQueryController, and sometimes custom subclasses). To tell an entity controller to use a nib file instead of dynamic generation, you use the entity controller's XML attribute archiveName.
When you use a frozen nib file, the application doesn't need the same controllers as it does when it dynamically generates the user interface. Since the nib file describes all of the widgets in the user interface, the application doesn't need any controllers whose sole purpose is to create and configure widgets. For example, EOTextFieldControllers aren't necessary because they do nothing more than create and configure a text field widget. Since the nib file takes over this responsibility, the controller hierarchy corresponding to a frozen nib shouldn't have any EOTextFieldControllers. It is, however, possible to use subcontrollers to generate portions of a user interface. Their components are added to the component of the controller in the usual way.
Remember that freezing interface files has many disadvantages: maintenance is more difficult, platform specific layout is harder to achieve, model changes aren't automatically incorporated, and so on. Therefore, carefully weigh the cost of freezing nib files against the benefits before using this approach.
© 1999 Apple Computer, Inc. – (Draft. Last updated 05 Jan 00)